﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="NewsFrom.aspx.cs" Inherits="News_NewsFrom" %>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
   <title>当前位置:新闻管理→新闻编辑</title>
	<link href="../css/css.css" rel="stylesheet" type="text/css" />
	<!--#include file="../js/KeyControl.js"-->
	<base target="_self" />	
	<script type="text/javascript" language="JavaScript">
     
		function CheckForm()
		{
		  if (editor.EditMode.checked==true)
		  	  document.form1.Content.value=editor.HtmlEdit.document.body.innerText;
		  else
		  	  document.form1.Content.value=editor.HtmlEdit.document.body.innerHTML; 
		  	  
//		  if(document.form1.Content.value == "")
//			{
//				alert("请输入内容！");
//				document.form1.Content.focus();
//				return false;
//			}	
			
		  return true;
		 }
		 
		 function ccc()
		 {
		   editor.HtmlEdit.document.body.innerHTML=document.form1.Content.value;
		   //alert(document.Form1.Content.value);
		 }
		function resetall()
		 {
		   document.form1.reset();
		   ccc();
		 }
		 
		 
		 
		 
	     var sUpID;              //关键字 
	     var sLink;                  //连接地址
	     var sFileName;              //原名称
	     var sHFileName;              //格式化后的文件名称


	     function UpFile(Obj)
	     {
		     var sFeatures   = "dialogHeight:165px;dialogWidth:405px;resizeable:no;help:no;status:no";
		     var obj  = showModalDialog("../uploadfiles/UpFile.aspx?UpID="+Obj+"&FileType=pic",window,sFeatures);
		     if(obj != undefined)
		     {
			     sUpID        = obj.sUpID;
			     sLink        = obj.sLink;
			     sFileName    = obj.sFileName;
			     sHFileName   = obj.sHFileName;
			     if(sLink != "" && sFileName!="" )
			     {
				     eval("form1.Picture"+sUpID+".value=\""+sFileName+"\";");
				     eval("form1.Hmap"+sUpID+".value=\""+sHFileName+"\";");
				     eval("window.document.all.Lmap"+sUpID+".innerHTML=\""+sLink+"\";");            
			     }  
		       }
		    }
			
	</script>
	
	
	<script type="text/javascript" language="JavaScript">
	

		function CheckFormMenu()
		{
			

		  if(document.form1.ddlBigClassid.value == "0")
			{
				alert("请选择大类！");
				document.form1.ddlBigClassid.focus();
				return false;
			}	
		  if(document.form1.txtTitle.value == "")
			{
				alert("请输入标题！");
				document.form1.txtTitle.focus();
				return false;
			}	
		  
		   var btnSave=window.document.getElementById("btnSave");
		   if(btnSave!=null)
		   btnSave.click();
		}
			
	</script>

</head>
<body  onload="ccc()" bgcolor="#EEFBFF" style =" background-image :url('../images/hit_bg.gif');"> 
	<% 
		Response.ExpiresAbsolute = System.DateTime.Now.AddSeconds(-1);
		Response.Expires = 0;
		Response.CacheControl = "no-cache";
	%>
	<form id="form1" runat="server" onsubmit="return CheckForm();" method="post" enctype="multipart/form-data"> 
		<div>			
<table style ="width :98%;"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
   <td valign ="middle"  style ="height :25; width :100%;" ><img id="imgIndicator" src ="../images/Indicator.jpg" style ="width :21; height :16;" alt ="当前位置" />当前位置：<asp:Label ID="Indicator" runat ="server" ></asp:Label></td>
   </tr> 
  <tr style ="height :1; background-color :#dddddd;">
    <td></td>
 </tr> 
</table>
<table style ="width :98%;"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr style ="height :5">
    <td></td>
 </tr> 
</table>
<table width="95%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="327AC6">
  <tr > 
    <td align="right" bgcolor="#F9F9FB" height="30" style="width: 97px"> <font color="#FF0000">*</font>大类</td>                
    <td align="left" bgcolor="#F9F9FB">
        <asp:DropDownList ID="ddlBigClassid"  DataTextField ="BigClassName" DataValueField ="ID" runat="server" Width="154px" ></asp:DropDownList></td>
  </tr>
  <tr> 
    <td height="30" bgcolor="#F9F9FB" style="width: 97px"> <div align="right"><font color="#FF0000">*</font>标题</div></td>                
    <td align="left" bgcolor="#F9F9FB"> 
      <asp:TextBox ID="txtTitle" runat="server" MaxLength="50" Width="520px"></asp:TextBox> 
                  <asp:RequiredFieldValidator ID="RequiredFieldValidator" runat="server" ErrorMessage="不能为空" ControlToValidate="txtTitle"></asp:RequiredFieldValidator></td>
  </tr>
  <tr> 
    <td align="right" bgcolor="#F9F9FB" height="30" style="width: 97px"> 关键字</td>                
    <td align="left" bgcolor="#F9F9FB"> 
      <asp:TextBox ID="txtkeyWords" runat="server" MaxLength="50" Width="520px"></asp:TextBox></td>
  </tr>
  <tr> 
    <td align="right" bgcolor="#F9F9FB" style="width: 97px"> 上传图片</td>                
    <td align="left" bgcolor="#F9F9FB">        
        &nbsp;<% if (sPic != "")
        {%><img src="UploadFile/<%=sPic%>" border="0" alt="已上传的图片" /><%}%>
        <input id="Pic" type="file" size="50" name="Pic" runat="server" /><input type ="hidden" id="HPicture" runat ="server" />        
        </td>
  </tr>
  <tr> 
    <td align="right" bgcolor="#F9F9FB" style="width: 97px"> 编辑</td>                
    <td align="left" bgcolor="#F9F9FB"> 
      <asp:TextBox ID="txtWriter" runat="server" MaxLength="20" Width="145px"></asp:TextBox>
                  来源 <asp:TextBox ID="txtWriterFrom" runat="server" MaxLength="50" Width="145px"></asp:TextBox>
                  发布日期 <asp:TextBox ID="txtAddtime" runat="server" MaxLength="50" Width="145px"></asp:TextBox></td>
  </tr>
  <tr> 
    <td align="right" bgcolor="#F9F9FB" style="width: 97px;"><font color="#FF0000">*</font>内容</td>                
    <td align="left" bgcolor="#F9F9FB" style="width: 560;"> 
      <asp:TextBox ID="Content" Style="display: none" runat="server" TextMode="MultiLine">&nbsp;</asp:TextBox> <iframe id="editor" style="width: 560px; height: 400px" src="../Editor/editor.aspx"
					frameborder="1" scrolling="no"></iframe></td>
  </tr>
  <tr> 
    <td align="right" bgcolor="#F9F9FB" style="width: 97px"> 
      <div align="right"> 是否发布</div></td>                
    <td align="left" bgcolor="#F9F9FB"> 
      <asp:RadioButtonList ID="rdoIsShow" runat="server" RepeatDirection="Horizontal"> 
                    <asp:ListItem Selected="True" Value="1">是</asp:ListItem>
                    <asp:ListItem Value="2">否</asp:ListItem>
                  </asp:RadioButtonList> </td>
  </tr>
  </table>
 <div align="center"> 
        <asp:Button ID="btnSave" runat="server" Text="提交" Width="0px" Height="0px" BackColor="White" BorderColor="White" ForeColor="White" />&nbsp;&nbsp;&nbsp; 
        <input type="button" id="Button1" value="提交" class="button03" onclick="CheckFormMenu();" />
        <input type="button" name="submit1"  value=" 清除 " class="button03" id="submit1" onclick="resetall();"/>
        <input type="button" id="btnClose" runat="server" value="关闭" class="button03" onclick="window.close();" />
      </div>
 <div align="center"> <asp:Label ID="labMessage" runat="server" ForeColor="Red"></asp:Label> </div>
		</div>
	</form>
</body>
</html>


